<?php if (is_array($models) && count($models) > 0) : ?>
    <div class="news documents">
    <?php foreach($models as $model) : $detailUrl = $this->controller->createUrl('/Site/documents/view',array('cat_id'=>$model->category_id,'locale'=>$model->localeDocument->locale,'id'=>$model->id,'alias'=>$model->localeDocument->alias)); ?>
        <div class="item clearfix">
            <h3><a href="<?php echo $detailUrl; ?>"><?php echo $model->localeDocument->title; ?></a></h3>
            <div class="extra"><?php $ts = strtotime($model->create_time); echo '<b>'.Yii::t('site/general','Published').' : </b>'.((Yii::app()->language=='vi_vn') ? date('d/m/Y',$ts) : date('m/d/Y',$ts)); ?></div>
            <div class="extra"><?php $ts = strtotime($model->update_time); echo '<b>'.Yii::t('site/general','Last updated').' : </b>'.date('h:i A',$ts).' | '.((Yii::app()->language=='vi_vn') ? date('d/m/Y',$ts) : date('m/d/Y',$ts)); ?></div>
            <div class="extra"><?php echo '<b>'.Yii::t('site/general','Downloads').' : </b>'.$model->downloads; ?></div>
            <div class="extra"><?php echo '<b>'.Yii::t('site/general','Views').' : </b>'.$model->views; ?></div>
            <div class="extra"><a href="<?php echo Yii::app()->createUrl('/Site/documents/download',array('id'=>$model->id)); ?>"><img border="0" src="<?php echo baseUrl().'/image/download.jpg'; ?>" /></a></div>
            <div class="extra"><?php echo getFirstWordsFromString(strip_tags($model->localeDocument->description),$this->content_limit); ?></div>
        </div>
    <?php endforeach; ?>
    </div>
    <div style="clear: both;"></div>
    <div class="pager">
        <?php
        $this->widget('CLinkPager',array(
            'pages' => $paging,
            'cssFile' => false,
            'header' => ''
        )); ?>
    </div>
<?php else : ?>
    <p><?php echo Yii::t('site/general','NO_DOCUMENT'); ?></p>
<?php endif; ?>